namespace ext.data
{
	using System;
	using System.Runtime.CompilerServices;
	using System.Html;
	using System.Collections;
	
	
	/// <summary>
	/// Data reader class to create an Array of {@link Ext.data.Record} objects
	/// from a JSON packet based on mappings in a provided {@link Ext.data.Record}
	/// constructor.  Example code:  
	/// var myReader = new Ext.data.JsonReader({
	/// // metadata configuration options:
	/// {@link #idProperty}: &apos;id&apos;
	/// {@link #root}: &apos;rows&apos;,
	/// {@link #totalProperty}: &apos;results&apos;,
	/// {@link Ext.data.DataReader#messageProperty}: &quot;msg&quot; // The element within the response that provides a user-feedback message (optional)
	///
	/// // the fields config option will internally create an {@link Ext.data.Record}
	/// // constructor that provides mapping for reading the record data objects
	/// {@link Ext.data.DataReader#fields fields}: [
	/// // map Record&apos;s &apos;firstname&apos; field to data object&apos;s key of same name
	/// {name: &apos;name&apos;, mapping: &apos;firstname&apos;},
	/// // map Record&apos;s &apos;job&apos; field to data object&apos;s &apos;occupation&apos; key
	/// {name: &apos;job&apos;, mapping: &apos;occupation&apos;}
	/// ]
	/// });
	///  This would consume a JSON data object of the form:  
	/// {
	/// results: 2000, // Reader&apos;s configured...
	/// </summary>
	/// <htmlSummary>
	/// &lt;p&gt;Data reader class to create an Array of {@link Ext.data.Record} objects
	/// from a JSON packet based on mappings in a provided {@link Ext.data.Record}
	/// constructor.&lt;/p&gt;
	/// &lt;p&gt;Example code:&lt;/p&gt;
	/// &lt;pre&gt;&lt;code&gt;
	/// var myReader = new Ext.data.JsonReader({
	/// // metadata configuration options:
	/// {@link #idProperty}: &apos;id&apos;
	/// {@link #root}: &apos;rows&apos;,
	/// {@link #totalProperty}: &apos;results&apos;,
	/// {@link Ext.data.DataReader#messageProperty}: &quot;msg&quot; // The element within the response that provides a user-feedback message (optional)
	///
	/// // the fields config option will internally create an {@link Ext.data.Record}
	/// // constructor that provides mapping for reading the record data objects
	/// {@link Ext.data.DataReader#fields fields}: [
	/// // map Record&amp;#39;s &apos;firstname&apos; field to data object&amp;#39;s key of same name
	/// {name: &apos;name&apos;, mapping: &apos;firstname&apos;},
	/// // map Record&amp;#39;s &apos;job&apos; field to data object&amp;#39;s &apos;occupation&apos; key
	/// {name: &apos;job&apos;, mapping: &apos;occupation&apos;}
	/// ]
	/// });
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;p&gt;This would consume a JSON data object of the form:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
	/// {
	/// results: 2000, // Reader&amp;#39;s configured {@link #totalProperty}
	/// rows: [ // Reader&amp;#39;s configured {@link #root}
	/// // record data objects:
	/// { {@link #idProperty id}: 1, firstname: &apos;Bill&apos;, occupation: &apos;Gardener&apos; },
	/// { {@link #idProperty id}: 2, firstname: &apos;Ben&apos; , occupation: &apos;Horticulturalist&apos; },
	/// ...
	/// ]
	/// }
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;p&gt;&lt;b&gt;&lt;u&gt;Automatic configuration using metaData&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
	/// &lt;p&gt;It is possible to change a JsonReader&apos;s metadata at any time by including
	/// a &lt;b&gt;&lt;tt&gt;metaData&lt;/tt&gt;&lt;/b&gt; property in the JSON data object. If the JSON data
	/// object has a &lt;b&gt;&lt;tt&gt;metaData&lt;/tt&gt;&lt;/b&gt; property, a {@link Ext.data.Store Store}
	/// object using this Reader will reconfigure itself to use the newly provided
	/// field definition and fire its {@link Ext.data.Store#metachange metachange}
	/// event. The metachange event handler may interrogate the &lt;b&gt;&lt;tt&gt;metaData&lt;/tt&gt;&lt;/b&gt;
	/// property to perform any configuration required.&lt;/p&gt;
	/// &lt;p&gt;Note that reconfiguring a Store potentially invalidates objects which may
	/// refer to Fields or Records which no longer exist.&lt;/p&gt;
	/// &lt;p&gt;To use this facility you would create the JsonReader like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
	/// var myReader = new Ext.data.JsonReader();
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;p&gt;The first data packet from the server would configure the reader by
	/// containing a &lt;b&gt;&lt;tt&gt;metaData&lt;/tt&gt;&lt;/b&gt; property &lt;b&gt;and&lt;/b&gt; the data. For
	/// example, the JSON data object might take the form:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
	/// {
	/// metaData: {
	/// &quot;{@link #idProperty}&quot;: &quot;id&quot;,
	/// &quot;{@link #root}&quot;: &quot;rows&quot;,
	/// &quot;{@link #totalProperty}&quot;: &quot;results&quot;
	/// &quot;{@link #successProperty}&quot;: &quot;success&quot;,
	/// &quot;{@link Ext.data.DataReader#fields fields}&quot;: [
	/// {&quot;name&quot;: &quot;name&quot;},
	/// {&quot;name&quot;: &quot;job&quot;, &quot;mapping&quot;: &quot;occupation&quot;}
	/// ],
	/// // used by store to set its sortInfo
	/// &quot;sortInfo&quot;:{
	/// &quot;field&quot;: &quot;name&quot;,
	/// &quot;direction&quot;: &quot;ASC&quot;
	/// },
	/// // {@link Ext.PagingToolbar paging data} (if applicable)
	/// &quot;start&quot;: 0,
	/// &quot;limit&quot;: 2,
	/// // custom property
	/// &quot;foo&quot;: &quot;bar&quot;
	/// },
	/// // Reader&amp;#39;s configured {@link #successProperty}
	/// &quot;success&quot;: true,
	/// // Reader&amp;#39;s configured {@link #totalProperty}
	/// &quot;results&quot;: 2000,
	/// // Reader&amp;#39;s configured {@link #root}
	/// // (this data simulates 2 results {@link Ext.PagingToolbar per page})
	/// &quot;rows&quot;: [ // &lt;b&gt;*Note:&lt;/b&gt; this must be an Array
	/// { &quot;id&quot;: 1, &quot;name&quot;: &quot;Bill&quot;, &quot;occupation&quot;: &quot;Gardener&quot; },
	/// { &quot;id&quot;: 2, &quot;name&quot;: &quot;Ben&quot;, &quot;occupation&quot;: &quot;Horticulturalist&quot; }
	/// ]
	/// }
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;p&gt;The &lt;b&gt;&lt;tt&gt;metaData&lt;/tt&gt;&lt;/b&gt; property in the JSON data object should contain:&lt;/p&gt;
	/// &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
	/// &lt;li&gt;any of the configuration options for this class&lt;/li&gt;
	/// &lt;li&gt;a &lt;b&gt;&lt;tt&gt;{@link Ext.data.Record#fields fields}&lt;/tt&gt;&lt;/b&gt; property which
	/// the JsonReader will use as an argument to the
	/// {@link Ext.data.Record#create data Record create method} in order to
	/// configure the layout of the Records it will produce.&lt;/li&gt;
	/// &lt;li&gt;a &lt;b&gt;&lt;tt&gt;{@link Ext.data.Store#sortInfo sortInfo}&lt;/tt&gt;&lt;/b&gt; property
	/// which the JsonReader will use to set the {@link Ext.data.Store}&apos;s
	/// {@link Ext.data.Store#sortInfo sortInfo} property&lt;/li&gt;
	/// &lt;li&gt;any custom properties needed&lt;/li&gt;
	/// &lt;/ul&gt;&lt;/div&gt;
	/// </htmlSummary>
	/// <definedin>src\data\JsonReader.js</definedin>
	[ScriptName("JsonReader")]
	[ScriptNamespace("Ext.data")]
	[Imported()]
	public partial class JsonReader : ext.data.DataReader
	{
		
		#region Constructors
		public JsonReader(ext.data.JsonReader_Configuration config)
		{
		}
		
		/// <summary>Constructor</summary>
		/// <param name="meta">Metadata configuration options.</param>
		/// <param name="recordType">
		/// &lt;p&gt;Either an Array of {@link Ext.data.Field Field} definition objects (which
		/// will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
		/// constructor created from {@link Ext.data.Record#create}.&lt;/p&gt;
		/// </param>
		public JsonReader(object meta, System.Array recordType)
		{
		}
		
		/// <summary>Constructor</summary>
		/// <param name="meta">Metadata configuration options.</param>
		/// <param name="recordType">
		/// &lt;p&gt;Either an Array of {@link Ext.data.Field Field} definition objects (which
		/// will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
		/// constructor created from {@link Ext.data.Record#create}.&lt;/p&gt;
		/// </param>
		public JsonReader(object meta, object recordType)
		{
		}
		
		/// <summary>Constructor</summary>
		public JsonReader()
		{
		}
		#endregion
		
		#region Fields
		/// <summary>
		/// [id] Name of the property within a row object
		/// that contains a record identifier value. Defaults to id
		/// </summary>
		/// <htmlSummary>
		/// [id] Name of the property within a row object
		/// that contains a record identifier value. Defaults to &lt;tt&gt;id&lt;/tt&gt;
		/// </htmlSummary>
		/// <definedin>src\data\JsonReader.js</definedin>
		[ScriptName("idProperty")]
		public string IdProperty;
		
		/// <summary>
		/// [success] Name of the property from which to
		/// retrieve the success attribute. Defaults to success. See
		/// {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
		/// for additional information.
		/// </summary>
		/// <htmlSummary>
		/// [success] Name of the property from which to
		/// retrieve the success attribute. Defaults to &lt;tt&gt;success&lt;/tt&gt;. See
		/// {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
		/// for additional information.
		/// </htmlSummary>
		/// <definedin>src\data\JsonReader.js</definedin>
		[ScriptName("successProperty")]
		public string SuccessProperty;
		
		/// <summary>
		/// [total] Name of the property from which to
		/// retrieve the total number of records in the dataset. This is only needed
		/// if the whole dataset is not passed in one go, but is being paged from
		/// the remote server. Defaults to total.
		/// </summary>
		/// <htmlSummary>
		/// [total] Name of the property from which to
		/// retrieve the total number of records in the dataset. This is only needed
		/// if the whole dataset is not passed in one go, but is being paged from
		/// the remote server. Defaults to &lt;tt&gt;total&lt;/tt&gt;.
		/// </htmlSummary>
		/// <definedin>src\data\JsonReader.js</definedin>
		[ScriptName("totalProperty")]
		public string TotalProperty;
		
		/// <summary>
		/// [undefined] Required. The name of the property
		/// which contains the Array of row objects. Defaults to undefined.
		/// An exception will be thrown if the root property is undefined. The data
		/// packet value for this property should be an empty array to clear the data
		/// or show no data.
		/// </summary>
		/// <htmlSummary>
		/// [undefined] &lt;b&gt;Required&lt;/b&gt;. The name of the property
		/// which contains the Array of row objects. Defaults to &lt;tt&gt;undefined&lt;/tt&gt;.
		/// An exception will be thrown if the root property is undefined. The data
		/// packet value for this property should be an empty array to clear the data
		/// or show no data.
		/// </htmlSummary>
		/// <definedin>src\data\JsonReader.js</definedin>
		[ScriptName("root")]
		public string Root;
		#endregion
		
		#region Properties
		/// <summary>
		/// This JsonReader&apos;s metadata as passed to the constructor, or as passed in
		/// the last data packet&apos;s metaData property.
		/// </summary>
		/// <htmlSummary>
		/// This JsonReader&apos;s metadata as passed to the constructor, or as passed in
		/// the last data packet&apos;s &lt;b&gt;&lt;tt&gt;metaData&lt;/tt&gt;&lt;/b&gt; property.
		/// </htmlSummary>
		/// <definedin>src\data\JsonReader.js</definedin>
		[ScriptName("meta")]
		[IntrinsicProperty()]
		public object Meta
		{
			get
			{
				throw new System.Exception("Imported - not implemented");
			}
			set
			{
			}
		}
		
		/// <summary>
		/// After any data loads, the raw JSON data is available for further custom processing. If no data is
		/// loaded or there is a load exception this property will be undefined.
		/// </summary>
		/// <definedin>src\data\JsonReader.js</definedin>
		[ScriptName("jsonData")]
		[IntrinsicProperty()]
		public object JsonData
		{
			get
			{
				throw new System.Exception("Imported - not implemented");
			}
			set
			{
			}
		}
		#endregion
		
		#region Methods
		/// <summary>This method is only used by a DataProxy which has retrieved data from a remote server.</summary>
		/// <definedin>src\data\JsonReader.js</definedin>
		/// <param name="response">The XHR object which contains the JSON data in its responseText.</param>
		/// <returns>
		/// data A data block which is used by an Ext.data.Store object as
		/// a cache of Ext.data.Records.
		/// </returns>
		[ScriptName("read")]
		public object Read(object response)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Decode a JSON response from server.</summary>
		/// <definedin>src\data\JsonReader.js</definedin>
		/// <param name="action">[Ext.data.Api.actions.create|read|update|destroy]</param>
		/// <param name="response">The XHR object returned through an Ajax server request.</param>
		/// <returns>A {@link Ext.data.Response Response} object containing the data response, and also status information.</returns>
		[ScriptName("readResponse")]
		public ext.data.Response ReadResponse(string action, object response)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Create a data block containing Ext.data.Records from a JSON object.</summary>
		/// <definedin>src\data\JsonReader.js</definedin>
		/// <param name="o">
		/// An object which contains an Array of row objects in the property specified
		/// in the config as &apos;root, and optionally a property, specified in the config as &apos;totalProperty&apos;
		/// which contains the total size of the dataset.
		/// </param>
		/// <returns>
		/// data A data block which is used by an Ext.data.Store object as
		/// a cache of Ext.data.Records.
		/// </returns>
		[ScriptName("readRecords")]
		public object ReadRecords(object o)
		{
			throw new System.Exception("Imported - not implemented");
		}
		#endregion
	}
}
